import { HTTP } from "../utils/http.js";

class TabModule extends HTTP {
	// 获取首页菜单数据
	getIndex(userid) {
		let data = {}
		if(userid) {
			data.userid = userid
		}
		return this.request({
			url: 'wxapp/index',
			data
		})
	}
	
	// 买券
	getBuyTicketList (page, key = '') {
		return this.request({
			url: 'buy_ticket',
			data: {
				page: page + 1,
				key
			}
		})
	}
	// 买券详情
	getBuyTicketDetail(id) {
		return this.request({
			url: 'goods/detail',
			data: {
				id
			}
		})
	}
	
	// 卖券
	getSellTicketList (page, key = '') {
		return this.request({
			url: 'sell_ticket',
			data: {
				page: page + 1,
				key
			}
		})
	}
	// 卖券详情
	getSellTicketDetail(id) {
		return this.request({
			url: 'stock/detail',
			data:{
				id
			}
		})
	}
}

module.exports =  new TabModule()